//
//  YTPickerView.h
//  YiTuUserClient
//
//  Created by 石少庸 on 2017/3/25.
//  Copyright © 2017年 YiTu. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, YTPickerType) {
    YTPickerTypeDate,// 正常的年月日时分显示
    YTPickerTypeHourMinute,// 只显示时分
    YTPickerTypeMonthDay,// 只显示年月日
    YTPickerTypeDataSource// 根据提供的dataarray显示
};

typedef void(^SelectedCompletion)(NSString *selectedString);

@protocol YTPickerViewDelegate <NSObject>

@optional
- (void)pickerViewDidDismiss:(NSString *)selectedString;

@end

@interface YTPickerView : UIView
/** 蒙版*/
@property (assign, nonatomic) BOOL dimmedMask;
/** 选择完成回调*/
@property (copy, nonatomic) SelectedCompletion completion;
/** 自定义数据源*/
@property (strong, nonatomic) NSArray<NSString *> *dataArray;
/** 提示文字*/
@property (copy, nonatomic) NSString *tips;
/** 代理*/
@property (weak, nonatomic) id<YTPickerViewDelegate> delegate;
/** 是否是生日类型的选择,如果是,则可以选择过去的时间*/
@property (assign, nonatomic) BOOL birthday;

/** 初始化方法*/
+ (instancetype)pickerWithType:(YTPickerType)type;
/** 初始化方法*/
+ (instancetype)pickerWithDataSource:(NSArray<NSString *> *)dataArray;
- (void)show;

@end
